package cn.lg.soar.general.entity;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.IBaseEntity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;


/**
 * 文件业务关系表
 * @author 41225
 * @since 2024-06-02
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "BizFile", description = "业务附件表")
@TableName("lg_general_biz_file")
public class BizFile {

    /**  */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId
    private Long id;

    /** 业务分类id */
    @NotNull(message = "业务分类id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "业务分类id")
    @ApiModelProperty(value = "业务分类id")
    private Integer bizTypeId;

    /** 业务id */
    @NotNull(message = "业务id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "业务id")
    @ApiModelProperty(value = "业务id")
    private Long bizId;

    /** 创建人 */
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @TableField(value = IBaseEntity.CREATE_BY, fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    @ApiModelProperty(value = "创建人")
    private Long createBy;

    /** 上传时间 */
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @ApiModelProperty(value = "创建时间")
    @TableField(value = IBaseEntity.CREATE_TIME, fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    protected LocalDateTime createTime;

    /** 文件id */
    @NotNull(message = "文件id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "文件id")
    @ApiModelProperty(value = "文件id")
    private Long fileId;

    /** 文件id */
    @NotNull(message = "文件id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "文件id")
    @ApiModelProperty(value = "文件id")
    private Long fileSize;

    /** 原文件名称 */
    @NotBlank(message = "原文件名称不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "原文件名称")
    @ApiModelProperty(value = "原文件名称")
    private String originalName;

    /** 文件id */
    @NotNull(message = "文件id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "文件id")
    @ApiModelProperty(value = "文件id")
    private String fileUrl;

}
